Nginx 安装禅道

静态友好方式(PATH_INFO)访问设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@test ~]# more /data/web/zendao/zentaopms/config/my.php 
<?php
$config->installed = true;
$config->debug = false;
$config->requestType = 'PATH_INFO'; // apache使用,nginx pathinfo方式路由
//$config->requestType = 'GET'; //nginx GET使用方式
$config->db->host = '192.168.1.189';
$config->db->port = '3306';
$config->db->name = 'zendao';
$config->db->user = 'zdadmin';
$config->db->password = 'zenDao.0420';
$config->db->prefix = 'zt_';
$config->webRoot = getWebRoot();
$config->default->lang = 'zh-cn';
$config->mysqldump = '/usr/local/mysql/bin/mysqldump';
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
server {
listen 80;
rewrite_log on;
server_name zd.tiger.com;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /data/web/zendao/zentaopms/www;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$args;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
root /data/web/zendao/zentaopms/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $request_uri;
include fastcgi_params;

}
}

GET访问方式设置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@test ~]# more /data/web/zendao/zentaopms/config/my.php 
<?php
$config->installed = true;
$config->debug = false;
//$config->requestType = 'PATH_INFO'; //apache使用,nginx pathinfo方式路由
$config->requestType = 'GET'; //nginx get使用方式
$config->db->host = '192.168.1.189';
$config->db->port = '3306';
$config->db->name = 'zendao';
$config->db->user = 'zdadmin';
$config->db->password = 'zenDao.0420';
$config->db->prefix = 'zt_';
$config->webRoot = getWebRoot();
$config->default->lang = 'zh-cn';
$config->mysqldump = '/usr/local/mysql/bin/mysqldump';
    server {
        listen       80;
        rewrite_log on;
        server_name  zd.tiger.com;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
        location / {
            root /data/web/zendao/zentaopms/www;
            index  index.html index.htm index.php;
            if (!-e $request_filename) {
                rewrite ^/(.*)$ /index.php/$1 last;
            break;
                }
        }  
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ \.php$ {
            root           /data/web/zendao/zentaopms/www;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include        fastcgi_params;

        }
    }

禅道开发者api只能本地打开
http://localhost:8080/index.php?m=dev&f=api&module=user

继开 wechat
欢迎加我的微信,共同交流技术